<?php
/**
 * @Author: anchen
 * @Date:   2017-04-24 21:54:31
 * @Last Modified by:   anchen
 * @Last Modified time: 2017-04-24 21:58:17
 */
/**
 * 获取文件扩展名（后缀）
 * @author liupeng
 * @return string
 */
function getExtension($filename){
    $myext = substr($filename,strrpos($filename,'.'));
    return str_replace('.','',$myext);
}

$filename = '我的文档.doc';
echo getExtension($filename);